﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace U9API.WebCache
{
    public class CacheFactory
    {
        /// <summary>
        /// 缓存类别
        /// </summary>
        public enum CacheType
        {
            //默认缓存
            DefaultCache = 0,
            /// <summary>
            /// 分布式Memcached缓存
            /// </summary>
            MemcachedCache = 1
        }
        /// <summary>
        /// 初始化
        /// </summary>
        /// <returns></returns>
        public static ICacheStorage CreateCacheFactory()
        {
            string Cache = "";
            if (CacheType.MemcachedCache.ToString() == Cache)
            {
                return new MemcachedCache();
            }
            else
                return new U9API.WebCache.DefaultCacheAdapter();
        }
    }
}